Repository navigation
feat(settings): keep-awake on and off on Android - #4290
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 13 files
Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.
View guided diff | Re-trigger cubic
|
I reviewed 14befc1 and the code looks right, but I cannot approve yet because the live device runs the PR body describes are not published. The PR body says the Redmi and JDY-AL50 runs are recorded in-repo, but no file in the diff holds them. The body has no commands, SHA or output either. Both new write paths (Android Not blocking, and fine to take or leave: Android The open P3 thread on the HarmonyOS settings test still applies: the test matches only the message text, and All 11 checks pass at 14befc1 and there are no conflicts. I had no device access and ran no local tests. The leaf tests would fail without the new cases, judged from the diff. Before merge, please post the Android and HarmonyOS keep-awake on/off evidence for this head. |
|
Evidence committed to the branch: 🤖 Generated with Claude Code |
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/evidence/android-keep-awake-2026-11-08.md">
<violation number="1" location="docs/evidence/android-keep-awake-2026-11-08.md:48">
P2: The transcript ends at `0` but only asserts that the user’s mask was later restored to `15`. Include the restoration command and its `settings get` output so reviewers can verify the device was left unchanged.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
|
Thanks for the update. At 124a99e the Android evidence now includes a shipped-backend section with CLI runs, and the new leaf test would fail against the old lowering. The HarmonyOS half still has no live proof, so the code needs one more round. All 11 checks pass and there are no conflicts. I read the diff and the device transcripts; I did not reproduce them on a device. The issue asks for evidence first on the HarmonyOS contribution: device, OS, build, commands and raw output. The HarmonyOS section is still prose that quotes two ack lines. It shows no Not blocking, and fine to take or leave: Android Could the original Seven threads from the earlier review still apply, and none can be resolved yet: the HarmonyOS evidence, the missing commit SHA, the unbacked restore claim, the CLI-less svc-true section, the read-back never compared and the fake Before merge, please publish the HarmonyOS live run in |
|
Head 124a99e now conflicts with main. Please rebase onto current main and push; the open findings from the earlier review still apply to the rebased head. |
…onyOS `settings keep-awake on|off` covers the screen-hold workaround automation had to reach for through raw device shells. Android runs `svc power stayon true|false`, which holds the screen while the device charges. HarmonyOS runs `power-shell timeout -o 2147483647`, the largest screen-off timeout the tool accepts, and `off` restores the system timeout with `power-shell timeout -r`. The setting joins the catalog as a device-level mobile toggle, so a named app is refused daemon-side with `setting_app_not_consumed`. The Android and HarmonyOS owners declare the write fact, and so does the Limrun Android leg. Co-Authored-By: Claude Code <noreply@anthropic.com>
…on refusal Review follow-up on the keep-awake slice. The help sentence now discloses persistence: the Android stay-on write survives a reboot, a reboot clears the HarmonyOS override, and `off` restores the timeout the system setting holds. `power-shell setmode` spells only the 600-series power modes, so `timeout -o` is the route that takes the raw 2147483647 millisecond value; the HarmonyOS comment now records that choice for the next reader. `keep-awake` joins the daemon `setting_app_not_consumed` parameterized cases, so the device-level app refusal is pinned at the daemon entry too. Co-Authored-By: Claude Code <noreply@anthropic.com>
…ack state svc power stayon true leaves a stored 15 untouched while acking, which a live Redmi K60 run exposed. The backend writes stay_on_while_plugged_in directly (7 for on, 0 for off) and returns the read-back value so the result cannot claim a write the device did not store. Evidence recorded in docs/evidence/. Co-Authored-By: Claude Code <noreply@anthropic.com>
…-back Co-Authored-By: Claude Code <noreply@anthropic.com>
124a99e to
73d04eb
Compare
Co-Authored-By: Claude Code <noreply@anthropic.com>
|
Rebased onto current main (one conflict: the R-series ReasonTable refactor in harmonyos runtime.ts — the PR's keep-awake message kept on the typed reason member). Live runs for both halves are recorded in docs/evidence/android-keep-awake-2026-11-08.md: Android (head 73d04eb, Redmi 2312DRAABC, Android 14/MIUI) — the repro ask answered from the other side: HarmonyOS (JDY-AL50, 7.0.0.111) — live with the screen state read from
So the PR's off contract ("off restores the timeout the system setting holds") does not hold after a hold was raised on 7.0.0.111. The unit now sits at an explicit Co-Authored-By: Claude Code noreply@anthropic.com |
|
Thanks for the update. Since the earlier review, the Android path is fixed. It now runs
The The earlier review asked for a HarmonyOS section with device, OS and build, raw Before merge, the HarmonyOS live run on the final head is required, showing that Of the other open inline threads, this one on the HarmonyOS evidence and this one on the restored mask still stand. The thread on the 73d04eb4a repro and the 86439819-era run also still applies, and one lower-priority thread on the HarmonyOS test assertion still applies. These no longer apply and can be resolved: the echoed-mask fixture (outdated, it belonged to the replaced hand-written put/get), the CLI invocation section (the CLI acks are shown, although for the replaced backend), and the read-back comparison (now compared with the request in CI shows 15 checks passing and Body rules failing in Not blocking, and these can be taken or left: the evidence doc still carries sections of the replaced Android backend (the Not verified here: any device run, the unit tests locally, and the reboot persistence claims in the help. The Android and HarmonyOS transcripts and the claim that Before merge, HarmonyOS |
…out per review The maintainer's live review on JDY-AL50 (HarmonyOS 7.0.0.111) proved power-shell timeout -r acks but does not clear an active -o override, so harmony off reported disabled while the hold stayed up. No proven restore route exists and no device is reachable to prove one, so the HarmonyOS half leaves this PR behind the maintainer's option B; Android lands alone. settings keep-awake now serves Android only: the harmony owner drops the keep-awake fact, so a harmony request refuses as unsupported-platform-leaf through the owner's settings facts before dispatch, and the catalog help loses its harmony clauses. A future PR may bring the half back behind a proven restore route recorded in the PR thread.
|
Taking the review's option B: HarmonyOS keep-awake leaves this PR and Android lands alone. Head The
So A future PR may bring the HarmonyOS half back behind a proven restore route. The removed evidence section lives on in this thread and in the updated |
|
Thanks for the update. At abbba3a the code looks good. The HarmonyOS keep-awake half and its evidence section are removed, and the Android path now uses the Not blocking: the PR title and the evidence doc intro at docs/evidence/android-keep-awake-2026-11-08.md:3 still say "Android and HarmonyOS", and the squash subject would carry that. They can be taken or left, but retitling to "feat(settings): keep-awake on and off on Android" and saying "Android" in the doc intro would match the code. Of the open inline threads, the one on the restored mask value in the evidence doc (#4290 (comment)) still stands as hygiene only. These threads no longer apply and can be resolved: the HarmonyOS invalid-state test, because the test was deleted with the branch (#4290 (comment)); the HarmonyOS live-transcript ask, because that half is removed (#4290 (comment)); the repro head pin (#4290 (comment)) and the CLI acks (#4290 (comment)), because the Android on/off proof is pinned and the older section documents the replaced backend; the echoed-mask fixture (#4290 (comment)), because the new svc tests cover write, read-back, not-applied and unreadable; and the read-back comparison (#4290 (comment)), because it is unchanged and was already confirmed. Not verified here: no HarmonyOS or Android device was used, and the device timings and runs were read from the evidence doc and the author comment. The 1566-test claim was not re-run locally. The Android live proof at the final lowering is raw adb at 73d04eb (0 -> 15 -> 0); the CLI run in the doc is from the replaced backend, which was already called welcome but not required. |
|
Route-hunt closure on the live unit (JDY-AL50, HarmonyOS 7.0.0.111), for the record: no shell-readable timeout source and no working restore primitive exist on this build.
So the HarmonyOS half stays out of this PR until one of those surfaces changes (an OS update fixing |
|
Thanks for closing the HarmonyOS route hunt. With no readable timeout source and no restore primitive on that build, dropping HarmonyOS keep-awake from this PR is the right scope, and the review at abbba3a found no blocking issue in the Android path. The remaining note is optional: a title that says Android only would match what ships. |
…ce intro The PR title and the shipped backend are Android-only after the HarmonyOS half moved out; the evidence intro still said "across Android and HarmonyOS". The HarmonyOS note stays as the recorded restore-route finding.
|
Thanks for the update. At dd45e0f the delta is a one-line docs change, and the code still has no blocking issue from the earlier review (#4290 (comment)). The live evidence is satisfied. The shipped svc-toggle lowering is covered live only by the raw-adb 0/15/0 repro, and the CLI read-back run comes from an earlier backend. Not verified here: the unit and integration tests were not run locally, no Android device was run, and Of the other open threads, none is a high-priority one that still applies, and none of the lower-priority ones apply. Please resolve these. The Harmony test thread targets a file no longer in the diff (#4290 (comment)). The restore-transcript thread asks about a backend that no longer ships, so it does not affect the shipped behavior (#4290 (comment)). The next four are fixed or moot: the not-applied and unreadable tests (#4290 (comment)), the pinned head SHA in the evidence file (#4290 (comment)), the HarmonyOS transcript, which moved out (#4290 (comment)), the CLI invocation shown in the evidence file (#4290 (comment)), and the read-back that now settles before reporting (#4290 (comment)). The Smoke Tests (ios) and Smoke Tests (macos) jobs passed, and they do not overlap with this Android-only diff. One Smoke Tests job was still pending at review time. No conflicts are known, and the PR is ready once that job finishes. |
Summary
Adds
settings keep-awakefor Android. It lowers tosvc power stayon true|falsethrough the global-toggle machinery (writeArgsdescriptor), polls thestay_on_while_plugged_inrow to a state, and reports typedkeep-awake-not-applied/keep-awake-unreadablewhen the read-back did not move or is not a mask. The write is explicit, so it does not skip a mask that already covers the plugged-in sources.HarmonyOS keep-awake left this PR per the maintainer's option B: on the tested unit (JDY-AL50, HarmonyOS 7.0.0.111),
power-shell timeout -racks but does not clear an active-ooverride, sooffcould report disabled while the hold stayed up. A harmony request now refuses as unsupported through the owner's settings facts. A future PR may bring the half back behind a proven restore route.Before / after
Base:
settings keep-awake onrefuses as unsupported on every platform. Head, Android on a physical Redmi (MIUI 14):End to end through the public CLI, device row read back between calls:
The mask value stays the device's (
svc truewrites 15 on MIUI); the result names only the state.Validation
Live runs in
docs/evidence/android-keep-awake-2026-11-08.md: raw-adb repro at head73d04eb4a(0 → 15 → 0), then the shipped lowering with read-back.pnpm vitest run settings command-surface contracts --project unit-coreat headabbba3a03: 1566 passed. The body is updated after each push and describes the current head.